package com.github.cyf.common.validator;

import com.github.cyf.common.validator.NumberScaleValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author chenyifan
 * @create 2024-09-30 14:59
 */
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = NumberScaleValidator.class)
public @interface NumberScale {
    String message() default "scale is error";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default { };

    int scale() default 10;

}
